<div class="row">
   <div class="col-md-12">

    <h2> Product List </h2>

    <table class="table table-bordered">
      <thead>
        <tr>
          <th width="80%">Product Info</th>
          <th>Price</th>
          <th>Quantity</th>
        </tr>
      </thead>
      <tbody>

        <% current_cart.cart_items.each do |cart_item| %>
          <tr>
            <td>
              <%= link_to(cart_item.product.title, product_path(cart_item.product)) %>
            </td>
            <td>
              <%= cart_item.product.price %>
            </td>

            <td>
              <%= cart_item.quantity %>
            </td>

          </tr>
        <% end %>

      </tbody>
    </table>

    <div class="total clearfix">
      <span class="pull-right">
        Total: <%= render_cart_total_price(current_cart) %> CNY
      </span>
    </div>

    <hr>

    <h2> Billing Info </h2>

    <div class="order-form">

      <%= simple_form_for @order do |f| %>



          <legend> Billing user</legend>
          <div class="form-group col-lg-6">
            <%= f.input :billing_name  %>
          </div>
          <div class="form-group col-lg-6">
            <%= f.input :billing_address  %>
          </div>

          <legend> Shipping user</legend>
          <div class="form-group col-lg-6">
           <%= f.input :shipping_name  %>
          </div>
          <div class="form-group col-lg-6">
            <%= f.input :shipping_address  %>
          </div>

        <div class="checkout">
          <%= f.submit "Create Order", class: "btn btn-lg btn-danger pull-right",
                       data: { disable_with: "Submitting..." } %>
        </div>
      <% end %>

    </div>
  </div>
</div>
